package week3rd;

import java.util.Scanner;

public class YHtriQueue {
    public static void main(String[] args) {
        CircularArrayQueue<Integer> ca = new CircularArrayQueue();
        ca.enqueue(0);
        ca.enqueue(1);
        ca.enqueue(0);

        Scanner scan = new Scanner(System.in);
        System.out.print("输入行数:");
        int n = scan.nextInt();

        System.out.println(ca);
        int a = 0, b = 0, ab = 0;

        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < i + 2; j++) {
                a = ca.dequeue();
                b = ca.first();
                ab = a + b;
                ca.enqueue(ab);
            }
            ca.enqueue(0);
            System.out.println(ca);
        }



    }
}
